/* Clear All Wait Statistics:
 * DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR)
 */
SET IMPLICIT_TRANSACTIONS OFF

SELECT wait_type, waiting_tasks_count, wait_time_ms, signal_wait_time_ms,
	[signal_wait_%]= CAST(ROUND(100.0*signal_wait_time_ms/wait_time_ms,1) AS DECIMAL(4,1))
  FROM sys.dm_os_wait_stats
  WHERE 0 < wait_time_ms
	AND wait_type NOT IN (
		'BROKER_TASK_STOP',
		'BROKER_TO_FLUSH',
		'CHECKPOINT_QUEUE',
		'CLR_AUTO_EVENT',
		'CLR_MANUAL_EVENT',
		'CLR_SEMAPHORE',
		'DISPATCHER_QUEUE_SEMAPHORE',
		'FT_IFTS_SCHEDULER_IDLE_WAIT',
		'LAZYWRITER_SLEEP',
		'LOGMGR_QUEUE',
		'REQUEST_FOR_DEADLOCK_SEARCH',
		'RESOURCE_QUEUE',
		'SLEEP_SYSTEMTASK',
		'SLEEP_TASK',
		'SQLTRACE_BUFFER_FLUSH',
		'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',
		'WAITFOR',
		'XE_DISPATCHER_JOIN',
		'XE_DISPATCHER_WAIT',
		'XE_TIMER_EVENT')
  ORDER BY 5 DESC, 3 DESC

SELECT [%cpu-waits]= CAST(ROUND(100.0*SUM(signal_wait_time_ms)/SUM(wait_time_ms),1) AS DECIMAL(4,1))
  FROM sys.dm_os_wait_stats
  WHERE 0 < wait_time_ms
	AND wait_type NOT IN (
		'BROKER_TASK_STOP',
		'BROKER_TO_FLUSH',
		'CHECKPOINT_QUEUE',
		'CLR_AUTO_EVENT',
		'CLR_MANUAL_EVENT',
		'CLR_SEMAPHORE',
		'DISPATCHER_QUEUE_SEMAPHORE',
		'FT_IFTS_SCHEDULER_IDLE_WAIT',
		'LAZYWRITER_SLEEP',
		'LOGMGR_QUEUE',
		'REQUEST_FOR_DEADLOCK_SEARCH',
		'RESOURCE_QUEUE',
		'SLEEP_SYSTEMTASK',
		'SLEEP_TASK',
		'SQLTRACE_BUFFER_FLUSH',
		'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',
		'WAITFOR',
		'XE_DISPATCHER_JOIN',
		'XE_DISPATCHER_WAIT',
		'XE_TIMER_EVENT')
GO